﻿using System;
using System.Data;
using VIT.DataHelper.DataAccess;

namespace VIT.Web.Modules.NewsSharedSecret
{
    public partial class NewsSharedSecret : VIT.Web.UI.VITModule
    {
        public string hasVideo, hasPagging;
        public string title, fileName, link;
        public int height;

        protected void Page_Load(object sender, EventArgs e)
        {
                if (!int.TryParse(Params["Height"], out height)) height = 210 ;
                hasVideo = Params["HasVideo"];
                //hasPagging = Params["HasPagging"];
                FeaturedNewsProvider fnp = new FeaturedNewsProvider();
                fnp.LanguageId = Session["language"].ToString();
                rpt.DataSource = fnp.loadTop(Params);
                rpt.DataBind();

            // ảnh vieo
                SQLSupport sqlSupport = new SQLSupport();
                string strQuery = "select top 1 FullLogo, Link, FileName, Title From Logo Where LanguageID='vi-VN' and PositionId='ShareVideo' and Type='Image' and Published=1";
                DataTable table = sqlSupport.ExecuteDataset(false, strQuery).Tables[0];
                if (table.Rows.Count > 0)
                {
                    title = table.Rows[0]["Title"].ToString();
                    fileName = table.Rows[0]["FileName"].ToString();
                    link = table.Rows[0]["Link"].ToString();
                }
                else
                {
                    title = fileName = link = "";
                }
        }

        protected void Pager_PreRender(object sender, EventArgs e)
        {
            //FeaturedNewsProvider fnp = new FeaturedNewsProvider();
            //fnp.LanguageId = Session["language"].ToString();
            //ListView.DataSource = fnp.loadTop(Params);
            //ListView.DataBind();
        }
    }
}